home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10325 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ?? How to dump text files to screen ??
  5. Date: Sat, 16 Mar 96 20:17:11 GMT
  6. Organization: none
  7. Message-ID: <827007431snz@genesis.demon.co.uk>
  8. References: <31430CE8.469E@aol2.com> <4iddva$aic@sue.cc.uregina.ca> <4idmr2INNol@keats.ugrad.cs.ubc.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4idmr2INNol@keats.ugrad.cs.ubc.ca>
  15.            c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
  16.  
  17. >There is no need to use a buffer. The putc() and getc() functions are often
  18. >defined as macros which operate directly and efficiently on the FILE structure,
  19. >calling for buffer flushes and replenishes as needed. The while() loop above is
  20. >probably more efficient than fgets(), and doesn't require extra buffering.
  21.  
  22. Well, that's possible but if it were true it wouldn't say much for your
  23. compiler/system's implementation of fgets(). In the efficiency stakes though
  24. on most systems your best bet is fread()/fwrite() with a sensible buffer
  25. size (say BUFSIZ or something derived from it).
  26.  
  27. -- 
  28. -----------------------------------------
  29. Lawrence Kirby | fred@genesis.demon.co.uk
  30. Wilts, England | 70734.126@compuserve.com
  31. -----------------------------------------
  32.